package com.orange.psx;

import java.util.HashMap;
import java.util.Map;

public class WarehouseImpl implements Warehouse {

    private Map<String, Integer> inventory = new HashMap<String, Integer>();
    
    public void add(String item, int number) {
        Integer currentNumber = inventory.get(item);
        if (currentNumber == null) {
            currentNumber = 0;
        }
        inventory.put(item, currentNumber + number);
    }

    public int getInventory(String item) {
        return inventory.get(item);
    }

}
